// pages/demo02/demo02.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    list:[
      {
        id:0,
        name:"模拟器",
        isActive:true
      },
      {
        id:1,
        name:"编辑器",
        isActive:false
      },
      {
        id:2,
        name:"调试器",
        isActive:false
      },
      {
        id:3,
        name:"可视化",
        isActive:false
      },
    ]

  },

  onItemClick(e){
    console.log('这里是父组件内的onItemClick事件',e);
    let {activeId} = e.detail;
    let {list} = this.data;
    list.forEach(item => item.isActive = item.id === activeId)
    this.setData({
      list
    })

    
  },


})